From: Jonas Dreßler Date: Sun, 14 Apr 2019 16:32:11 +0000 (+0200) Subject: lookingGlass: Replace global grabs with input device grabs X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~86 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6c33aff6d1b0e0620b7156a67a38bd99204347d2;p=gnome-shell.git lookingGlass: Replace global grabs with input device grabs Global grabs are being removed from Clutter in favour of input device grabs. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/495 --- diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 4e5b988ba..e191b509e 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -491,8 +491,13 @@ var Inspector = GObject.registerClass({ eventHandler.connect('button-press-event', this._onButtonPressEvent.bind(this)); eventHandler.connect('scroll-event', this._onScrollEvent.bind(this)); eventHandler.connect('motion-event', this._onMotionEvent.bind(this)); - Clutter.grab_pointer(eventHandler); - Clutter.grab_keyboard(eventHandler); + + let dm = Clutter.DeviceManager.get_default(); + this._pointerDevice = dm.get_core_device(Clutter.InputDeviceType.POINTER_DEVICE); + this._keyboardDevice = dm.get_core_device(Clutter.InputDeviceType.KEYBOARD_DEVICE); + + this._pointerDevice.grab(eventHandler); + this._keyboardDevice.grab(eventHandler); // this._target is the actor currently shown by the inspector. // this._pointerTarget is the actor directly under the pointer. @@ -525,8 +530,8 @@ var Inspector = GObject.registerClass({ } _close() { - Clutter.ungrab_pointer(); - Clutter.ungrab_keyboard(); + this._pointerDevice.ungrab(); + this._keyboardDevice.ungrab(); this._eventHandler.destroy(); this._eventHandler = null; this.emit('closed');